package YAPserver.mods;

import YAPenvironment.YAPconstant.ModState;
import YAPserver.gameObjects.Mod;
import YAPserver.logic.GameModifier;
import YAPserver.logic.Player;

/**
 * In this package are all of the different modBehaviours and what they do. Every modBehaviour implements this. There are to types of modBehaviours local (or player) and global.
 * There are two methods to modify and to revert the action using modify() and deModify() respectively.
 * When the mod calls this modify method it automatically is set to activated and then removed from the moving mods list in the game logic. (Specifically through the
 * interaction between GamePlay and StandardAbstract.
 * @author Daniel
 *
 */

public interface ModBehaviour {
	/**
	 * Modifies an aspect of the game either locally (for just one player) or globally (affects all players). This method is typically
	 * called by the mods activate() method.
	 * @param mod mod that has been activated
	 * @param gameMod gameModifier for changing elements of the game
	 * @param player player who is to be affected, though if the modBehaviour is global, this argument can be null
	 * @see Mod
	 * @see GameModifier
	 */
	public void modify(Mod mod, GameModifier gameMod, Player player);
	/**
	 * Reverts the action of the modBehaviour. Note that not all modBehaviours have an implemented deModify() method. Sometimes it isn't wanted that the
	 * action is reverted. In this case the deModify() method is empty.
	 * @param mod mod that had been activated
	 * @param gameMod gameModifier for reverting elements of the game
	 * @param player player who had been affected by the mod, though if the modBehaviour was global, this argument can be null
	 * @see #modify(Mod, GameModifier, Player)
	 */
	public void deModify(Mod mod, GameModifier gameMod, Player player);
	/**
	 * Returns the type of modBehaviour. Either local (ModState.player) or global (ModState.global).
	 * @return the type of modBehaviour
	 */
	public ModState getType();
}
